package com.example.medicine.View;

import com.example.medicine.Bean.dilixinxi;
import com.example.medicine.Mapper.dlxxMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class DlxxView {
    @Autowired
    private dlxxMapper dlxxMapper;
    @RequestMapping("/dlxx/create")
    public String dlxxCreateShow(){
        return "pages/dlxx/create";
    }
    /**
     * Dlxx编辑展示页面
     */
    @RequestMapping("/dlxx/edit/{id}")
    public String getDlxxById(@PathVariable int id, Model model){
        dilixinxi dilixinxi= dlxxMapper.getById(id);
        dilixinxi.setId(id);
        model.addAttribute("dlxx", dilixinxi);
        return "pages/dlxx/edit";
    }
}
